package cn.lcc.utils.demo.client;


import cn.lcc.utils.demo.jt808.TE;
import cn.lcc.utils.demo.jt808.UD_DEMO;
import com.alibaba.fastjson2.JSON;
import hy.iot.core.annotation.Endpoint;
import hy.iot.core.annotation.Mapping;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.stereotype.Component;


@Endpoint
@Component
public class JT808Endpoint {

    @Mapping(pointType="TE",types = 0x4445, desc = "测试")
    public void UD_DE(TE d, ChannelHandlerContext ctx) {
        System.out.println("===============UD_DE");
    }

    @Mapping(pointType="UD_DEMO",types = 0x4f, desc = "测试")
    public void UD_DEMO(UD_DEMO d, ChannelHandlerContext ctx) {
        System.out.println("===============UD_DEMO"+ JSON.toJSONString(d)+" ==== "+ctx.name());
    }

    @Mapping(pointType="0x0a",types = 0x5f, desc = "测试")
    public void UD_DEMOs(UD_DEMO d, ChannelHandlerContext ctx) {
        System.out.println("===============UD_DEMO"+ JSON.toJSONString(d)+" ==== "+ctx.name());
    }
}